From: Philip Withnall Date: Mon, 7 Aug 2017 13:13:30 +0000 (+0100) Subject: ostree/parse-datetime: Ensure tm structs are initialised X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~33^2~28 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=86dce4b252005949a4f9a4f7b4666982b12a84d4;p=ostree.git ostree/parse-datetime: Ensure tm structs are initialised Otherwise tm.tm_wday remains uninitialised and gets propagated elsewhere. Spotted by Coverity as issue #209265. Signed-off-by: Philip Withnall Closes: #1059 Approved by: cgwalters --- diff --git a/src/ostree/parse-datetime.y b/src/ostree/parse-datetime.y index f5688d30..50917354 100644 --- a/src/ostree/parse-datetime.y +++ b/src/ostree/parse-datetime.y @@ -1280,8 +1280,8 @@ parse_datetime (struct timespec *result, char const *p, time_t Start; long int Start_ns; struct tm const *tmp; - struct tm tm; - struct tm tm0; + struct tm tm = { 0, }; + struct tm tm0 = { 0, }; parser_control pc; struct timespec gettime_buffer; unsigned char c;